package sample.common;

import com.jfoenix.controls.JFXAlert;
import com.jfoenix.controls.JFXProgressBar;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class ViewStage {
//    private ProgressIndicator progressIndicator;
    JFXProgressBar jfxProgressBar = new JFXProgressBar();
    JFXAlert jfxAlert = new JFXAlert();
    private Stage stage = new Stage();
    public void setProgressIndicator(JFXProgressBar progressIndicator) {
        this.jfxProgressBar = progressIndicator;
    }
    public ViewStage(JFXProgressBar progressIndicator) {
        this.jfxProgressBar = progressIndicator;
    }

    public ViewStage() {

    }
    public void stageShow() {
        jfxAlert.setContent(jfxProgressBar);
        jfxAlert.show();
//        AnchorPane root = new AnchorPane();
//        VBox vBox = new VBox();
//        vBox.setAlignment(Pos.CENTER);
//
//        vBox.getChildren().add(progressIndicator);
//        root.getChildren().add(vBox);
//        AnchorPane.setTopAnchor(vBox,100.0);
//        AnchorPane.setRightAnchor(vBox,100.0);
//        AnchorPane.setLeftAnchor(vBox,100.0);
//        Scene scene = new Scene(root);
//        stage.setHeight(500);
//        stage.setWidth(500);
//        stage.setScene(scene);
//        stage.show();
    }
    public void closeAlert(){
        jfxAlert.close();
    }

}
